<?php

// Sécurité
if (!defined("_ECRIRE_INC_VERSION")) return;

/**
 * Action to generate invoice in form of Excel file 
 * @param int $arg
 * @return unknown_type
 */
function action_alohacart_payment_invoice_dist($arg=null) {
	if (is_null($arg)){
		$securiser_action = charger_fonction('securiser_action', 'inc');
		$arg = $securiser_action();
	}

    $id_order = intval($arg);
    
    include_spip('functions/pdk_common');
    $InvoiceCreator = pdk_load_class('InvoiceCreatorExcel', 'classes/payment/invoice/'); 
    $InvoiceCreator->OutputInvoice($id_order);
}

?>
